package com.yodawnla.littleWar.ui;

import org.anddev.andengine.engine.camera.hud.HUD;
import org.anddev.andengine.entity.Entity;
import org.anddev.andengine.entity.sprite.Sprite;

import com.yodawnla.lib.YoActivity;
import com.yodawnla.lib.YoScene;
import com.yodawnla.lib.util.widget.YoHudMgr;
import com.yodawnla.littleWar.system.Tex;
import com.yodawnla.littleWar.ui.HudMgr.Hud;

public class NameHud
{
	String mHudName;
	YoScene mScene;
	YoHudMgr mHudMgr = YoHudMgr.getInstance();
	YoActivity mBaseActivity = YoActivity.getBaseActivity();
	HUD mHud = YoHudMgr.getInstance().getHud();
	
	static NameHud instance;
	public static NameHud getInstance()
	{
		if (instance == null)
			instance = new NameHud();
		return instance;
	}
	
	NameHud()
	{
		mHudName = Hud.NameHud;
		
		Entity hudLayer = mHudMgr.getHudLayer(mHudName);

		Sprite herat = new Sprite(3,  1, mBaseActivity.getTexture(Tex.heart));
		hudLayer.attachChild(herat);
		
		Sprite AccountBar = new Sprite(65,  5, mBaseActivity.getTexture(Tex.nameBar));
		hudLayer.attachChild(AccountBar);
		Sprite nameBar = new Sprite(65,  26, mBaseActivity.getTexture(Tex.nameBar));
		hudLayer.attachChild(nameBar);
		
		Sprite goldBar = new Sprite(280,  5, mBaseActivity.getTexture(Tex.goldBar));
		hudLayer.attachChild(goldBar);
	}
	
	public void show(YoScene scene)
	{
		mScene = scene;
		mHudMgr.showHudLayer(mHudName);
	}
	
	public void hide()
	{
		mHudMgr.hideHudLayer(mHudName);
	}
}